import request from '@/config/axios'

// 功能类型 VO
export interface FunctionTypeVO {
  id: number // ID
  name: string // 类型名称
  createTime: []
  tenant_id: number
}

// 功能类型 API
export const FunctionTypeApi = {
  // 查询功能类型分页
  getFunctionTypePage: async (params: any) => {
    return await request.get({ url: `/package/function-type/page`, params })
  },

  // 查询功能类型详情
  getFunctionType: async (id: number) => {
    return await request.get({ url: `/package/function-type/get?id=` + id })
  },

  // 新增功能类型
  createFunctionType: async (data: FunctionTypeVO) => {
    return await request.post({ url: `/package/function-type/create`, data })
  },

  // 修改功能类型
  updateFunctionType: async (data: FunctionTypeVO) => {
    return await request.post({ url: `/package/function-type/update`, data })
  },

  // 删除功能类型
  deleteFunctionType: async (id: number) => {
    return await request.get({ url: `/package/function-type/delete?id=` + id })
  },

  // 获取类型列表
  getFunctionList: async (name: string) => {
    return await request.get({url: `/package/function-type/list?name=` + name})
  }
}